package com.lemon.model;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "T_Shop", schema = "LemonDb", catalog = "")
public class ShopEntity {
    private int id;
    private Integer shopOnwer;
    private String shopName;
    private Timestamp createtime;
    private Timestamp expiretime;
    private Integer visible;
    private String shopDesc;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "shop_onwer")
    public Integer getShopOnwer() {
        return shopOnwer;
    }

    public void setShopOnwer(Integer shopOnwer) {
        this.shopOnwer = shopOnwer;
    }

    @Basic
    @Column(name = "shop_name")
    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    @Basic
    @Column(name = "createtime")
    public Timestamp getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Timestamp createtime) {
        this.createtime = createtime;
    }

    @Basic
    @Column(name = "expiretime")
    public Timestamp getExpiretime() {
        return expiretime;
    }

    public void setExpiretime(Timestamp expiretime) {
        this.expiretime = expiretime;
    }

    @Basic
    @Column(name = "visible")
    public Integer getVisible() {
        return visible;
    }

    public void setVisible(Integer visible) {
        this.visible = visible;
    }

    @Basic
    @Column(name = "shop_desc")
    public String getShopDesc() {
        return shopDesc;
    }

    public void setShopDesc(String shopDesc) {
        this.shopDesc = shopDesc;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ShopEntity that = (ShopEntity) o;

        if (id != that.id) return false;
        if (shopOnwer != null ? !shopOnwer.equals(that.shopOnwer) : that.shopOnwer != null) return false;
        if (shopName != null ? !shopName.equals(that.shopName) : that.shopName != null) return false;
        if (createtime != null ? !createtime.equals(that.createtime) : that.createtime != null) return false;
        if (expiretime != null ? !expiretime.equals(that.expiretime) : that.expiretime != null) return false;
        if (visible != null ? !visible.equals(that.visible) : that.visible != null) return false;
        if (shopDesc != null ? !shopDesc.equals(that.shopDesc) : that.shopDesc != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (shopOnwer != null ? shopOnwer.hashCode() : 0);
        result = 31 * result + (shopName != null ? shopName.hashCode() : 0);
        result = 31 * result + (createtime != null ? createtime.hashCode() : 0);
        result = 31 * result + (expiretime != null ? expiretime.hashCode() : 0);
        result = 31 * result + (visible != null ? visible.hashCode() : 0);
        result = 31 * result + (shopDesc != null ? shopDesc.hashCode() : 0);
        return result;
    }
}
